package org.chen.response;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

@Data
@AllArgsConstructor
public class Page<T> {
    private List<T> records;      // 数据列表
    private long total;           // 总记录数
    private int size;            // 每页显示条数
    private int current;         // 当前页
    
    // 静态构造方法，方便使用
    public static <T> Page<T> of(List<T> records, long total, int size, int current) {
        return new Page<>(records, total, size, current);
    }

    public Page(List<T> records, long total) {
        this.records = records;
        this.total = total;
    }
}